package com.winshare.saleAssistant.domain.dto.req;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

@ApiModel
public class SupplierCreateDTO {

    @NotBlank(message = "编号不可以为空")
    @Length(min = 1, max = 20, message = "编号长度需要在1-20个字符之间")
    @ApiModelProperty(value = "编号")
    private String supplierCode;

    @NotBlank(message = "名称不可以为空")
    @Length(min = 1, max = 80, message = "名称长度需要在1-80个字符之间")
    @ApiModelProperty(value = "名称")
    private String supplierName;

    @NotBlank(message = "联系人不可以为空")
    @Length(min = 1, max = 20, message = "联系人长度需要在1-20个字符之间")
    @ApiModelProperty(value = "联系人")
    private String contactPerson;

    @NotBlank(message = "电话不可以为空")
    @Length(min = 1, max = 20, message = "电话长度需要在1-20个字符之间")
    @ApiModelProperty(value = "电话")
    private String phone;

    @NotBlank(message = "appId不可以为空")
    @Length(min = 1, max = 50, message = "appId长度需要在1-50个字符之间")
    @Pattern(regexp = "^[A-Za-z0-9]+$",message = "appId只能输入由数字和26个英文字母组成的字符串")
    @ApiModelProperty(value = "appId")
    private String appId;

    @NotBlank(message = "接口地址不可以为空")
    @Length(min = 1, max = 200, message = "接口地址长度需要在1-200个字符之间")
    @ApiModelProperty(value = "接口地址")
    private String url;

    @NotBlank(message = "地址不可以为空")
    @Length(min = 1, max = 100, message = "地址长度需要在1-100个字符之间")
    @ApiModelProperty(value = "地址")
    private String address;

    public SupplierCreateDTO() {
    }

    public String getSupplierCode() {
        return supplierCode;
    }

    public void setSupplierCode(String supplierCode) {
        this.supplierCode = supplierCode;
    }

    public String getSupplierName() {
        return supplierName;
    }

    public void setSupplierName(String supplierName) {
        this.supplierName = supplierName;
    }

    public String getContactPerson() {
        return contactPerson;
    }

    public void setContactPerson(String contactPerson) {
        this.contactPerson = contactPerson;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }
}
